package com.atguigu.gmall.user.service.impl;

import com.atguigu.gmall.common.config.utils.UserAuthUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.gmall.user.entity.UserAddress;
import com.atguigu.gmall.user.service.UserAddressService;
import com.atguigu.gmall.user.mapper.UserAddressMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author weiranyi
* @description 针对表【user_address(用户地址表)】的数据库操作Service实现
* @createDate 2022-12-15 11:56:44
*/
@Service
public class UserAddressServiceImpl extends ServiceImpl<UserAddressMapper, UserAddress>
    implements UserAddressService{

    @Override
    public List<UserAddress> getUserAddress() {
        String userId = UserAuthUtil.getUserIdHeader();
        List<UserAddress> userAddresses = lambdaQuery().eq(UserAddress::getId, userId).list();
        return userAddresses;
    }
}




